<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="webtag" uri="http://www.iflexsys.tagslib.com.vn"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8" isELIgnored="false"%>
<html>
<head>
<script type="text/javascript">
$(document).ready(function(){
	$('.askDelBook').jConfirmAction();
});
</script>
<title>Thông tin audio</title>
</head>
<body>
	<div>
		<form id="searchAudioBook" action="searchAudioBook" method="POST">
			<h2>Thông tin audio</h2>
			<input type="image" class="search_submit" src="<spring:theme code="theme.admin.images"/>/search.png" />
			<input type="text" name="keyword" class="search_input" placeholder="search keyword" value="${keyword}"/> 
			<input type="hidden" id="pageIndexId" name="pageIndex" value="1">
		</form>
	</div>

	<table id="rounded-corner" class="tableContent">
		<thead>
			<tr>
				<th scope="col" class="rounded-company"></th>
				<th scope="col" class="rounded">Tên Audio</th>
				<th scope="col" class="rounded">Mô tả</th>
				<th scope="col" class="rounded">Giá</th>
				<th scope="col" class="rounded">Giảm giá</th>
				<th scope="col" class="rounded">Trạng thái</th>
				<th scope="col" class="rounded">Sửa</th>
				<th scope="col" class="rounded-q4">Xóa</th>
			</tr>
		</thead>
		<c:choose>
			<c:when test="${empty audioBooks}">
				<tfoot><tr> <td colspan="8" align="center">Không tìm thấy bản ghi nào phù hợp </td></tr></tfoot>
			</c:when>
			<c:otherwise>
				<tbody>
				<c:forEach var="audio" items="${audioBooks}">
				<tr>
					<td></td>
					<td>${audio.title}</td>
					<td>${audio.description }</tdbook>
					<td>${audio.price}</td>
					<td>${audio.discount} %</td>
					<td>
						<c:choose>
							<c:when test="${audio.active == 1}">Hiển thị</c:when>
							<c:otherwise>Không hiển thị</c:otherwise>
						</c:choose>
					</td>
					<td>
						<a href="edit-audio-book?id=${audio.id}">
							<img src="<spring:theme code="theme.admin.images"/>/user_edit.png" alt="" title="" border="0" />
						</a>
					</td>
					<td><a href="delete-audio-book?id=${audio.id}" class="askDelBook">
						<img src="<spring:theme code="theme.admin.images"/>/trash.png"
						alt="" title="" border="0" />
					</a></td>
				</tr>
				</c:forEach>
				<tbody>
			</c:otherwise>
		</c:choose>
	</table>

	<c:if test="${fn:length(audioBooks) > 0}">
		<div class="pagination">
			<webtag:pagination pagingInfo="${pagingInfo}"
				pageIndexId="pageIndexId" formId="searchAudioBook" />
		</div>
	</c:if>
</body>
</html>